package com.ljd.controller;


import com.ljd.service.StatisticsDailyService;
import com.ljd.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.PushbackInputStream;
import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author ljd
 * @since 2022-01-07
 */
@RestController
@RequestMapping("/eduStatistics")
//@CrossOrigin
public class StatisticsDailyController {
    @Autowired
    StatisticsDailyService statisticsDailyService;
    @PostMapping("createStatisticsByDay/{day}")
    public R createStatisticsByDay(@PathVariable String day){
        statisticsDailyService.createStatisticsByDay(day);
        return R.ok();
    }
    @GetMapping("showChart/{type}/{start}/{end}")
    public R showChart(@PathVariable String type,@PathVariable String start,@PathVariable String end){
        Map<String,Object> map = statisticsDailyService.showChart(type,start,end);
        return R.ok().data(map);
    }
}

